package com.example.controller;

import com.example.common.Result;
import com.example.entity.Order;
import com.example.entity.Order_Product;
import com.example.entity.Review;
import com.example.service.ReviewService;
import com.github.pagehelper.PageInfo;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/review")
public class ReviewController {
    @Resource
    private ReviewService reviewService;


    @PostMapping("/add")
    public  Result createOrder(@RequestBody Review review) {

        reviewService.createReview(review);
        return Result.success();
    }
    @GetMapping("/getByOrderNo")
    public Result getByOrderNo(@RequestParam("orderNo") String orderNo) {
        Review review= reviewService.selectByOrderNo(orderNo);
        return Result.success(review);
    }


}
